//
//  main.m
//  Demo0006
//
//  Created by zTercel on 13-1-1.
//  Copyright (c) 2013年 zTercel. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Student.h"
#import "BadStudent.h"
#import "GoodStudent.h"

int main(int argc, const char * argv[])
{
    @autoreleasepool {
        
        @try {
            id ztercel = [[BadStudent alloc] init: "zTercel" age: 25 sex: YES];
            id ytercel = [[GoodStudent alloc] init: "yTercel" age: 25 sex: NO];
            
            [ztercel print];
            [ztercel habit];
            [ztercel playGame];
            
            [ytercel print];
            [ytercel habit];
            if ([ytercel respondsToSelector: @selector(playGame)] == YES)
            {
                [ytercel playGame];
            }
        } @catch (NSException* exception) {
            NSLog(@"\nException: %@  %@", [exception name], [exception reason]);
        }
    }
    return 0;
}

